/**
 * @description: dingtalkRobot参数校验
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';
import { requiredNumber, requiredString,requiredAny, requiredObject, PageDTO  } from "./common";

// 分页查询
export class GetAlarmPageDTO extends PageDTO {
  @Rule(RuleType.any())
  filterDateType: any;
  @Rule(RuleType.any())
  filterDate: any;
  @Rule(RuleType.any())
  alarmStyle: any;
  @Rule(RuleType.any())
  alarmStatus: any;
}
// 新增
export class InsertAlarmDTO {
  @Rule(requiredString)
  alarmName: string;
  @Rule(RuleType.string())
  alarmContent: string;
  @Rule(requiredString)
  alarmType: string;
  @Rule(requiredNumber)
  alarmTime: number;
  @Rule(requiredString)
  alarmEndtime: string;
  @Rule(requiredAny)
  alarmUserid: any;
  @Rule(requiredObject)
  alarmInner: object;
  @Rule(RuleType.number())
  brandId: number;
  @Rule(RuleType.string())
  brandName: string;
  @Rule(RuleType.number())
  projectId: number;
  @Rule(RuleType.string())
  projectName: string;
  @Rule(RuleType.string())
  alarmStyle: string;
}
// 更新
export class UpdateAlarmDTO extends InsertAlarmDTO {
  @Rule(requiredNumber)
  id: number;
}
// 更新状态
export class UpdateAlarmStatusDTO {
  @Rule(requiredNumber)
  id: number;
  @Rule(requiredString)
  alarmStatus: string;
}
// 发送消息
export class SendAlarmMsgDTO {
  @Rule(requiredNumber)
  id: number;
  @Rule(RuleType.string())
  msg: string;
}
